home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume91 / utilitys / nodelet5 / part01
Internet Message Format  |  1991-03-21  |  29KB

  1. Path: news.larc.nasa.gov!amiga-request
  2. From: amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
  3. Subject: v91i067: NoDelete 1.5a - intercept DeleteFile() requests, Part01/01
  4. Reply-To: hoover@math4.uni-bielefeld.de (Uwe Sch"urkamp)
  5. Newsgroups: comp.sources.amiga
  6. Message-ID: <comp.sources.amiga:v91i067@ab20.larc.nasa.gov>
  7. Date: 21 Mar 91 12:49:12 GMT
  8. Approved: tadguy@uunet.UU.NET (Tad Guy)
  9. X-Mail-Submissions-To: amiga@uunet.uu.net
  10. X-Post-Discussions-To: comp.sys.amiga.misc
  11.  
  12. Submitted-by: hoover@math4.uni-bielefeld.de (Uwe Sch"urkamp)
  13. Posting-number: Volume 91, Issue 067
  14. Archive-name: utilities/nodelete-1.5a/part01
  15.  
  16. [ includes uuencoded executable  ...tad ]
  17.  
  18.                      CHANGES TO VERSION 1.4: MAR 1991
  19. Switched  to  ARP  (finally).   This  great  bunch  of routines should have
  20. experienced  a  wide  enough  distribution  by now to make this acceptable.
  21. Cheers to everyone involved in this project!  ARP is used to do the pattern
  22. matching  on filenames.  No more restriction is made on the patterns.  They
  23. can  be  complete  filenames  or  just  patterns,  with  every ARP wildcard
  24. allowed.   I forgot the name of the guy who suggested this one, and answers
  25. by  UUCP  is not a favourite of math4.unibi.de.  Anyway, as soon as this is
  26. implemented, you'll get a "thank you", mate!
  27.  
  28.                               WHAT IT DOES
  29. NoDelete  enables  you  erraneous  humans  to  once  again  reflect  on the
  30. righteousness  of  your  decisions  concerning  the  deleting  of  files on
  31. AmigaDos devices.  If you try to delete a file or a program tries to remove
  32. it,  this  is  mostly  done  via  DeleteFile()  of  the  dos.library.  When
  33. executed,  NoDelete  bends  this  vector to its own routine which brings up
  34. this  cute  little requester on the active window.  This requester contains
  35. the  name  of  the file that the system is trying to delete.  If you really
  36. want  to  delete  this  file,  click to the "Yes, Delete!" gadget.  If not,
  37. click  to the "Oops, no way!"-Gadget of the requester.  NoDelete works just
  38. fine   with   aliases,   wildcards   etc.   For  problems  see  the  "known
  39. bugs"-section of this text.
  40.  
  41.  
  42. #!/bin/sh
  43. # This is a shell archive.  Remove anything before this line, then unpack
  44. # it by saving it into a file and typing "sh file".  To overwrite existing
  45. # files, type "sh file -c".  You can also feed this as standard input via
  46. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  47. # will see the following message at the end:
  48. #        "End of archive 1 (of 1)."
  49. # Contents:  nodelete.c nodelete.doc nodelete.uu
  50. # Wrapped by tadguy@ab20 on Thu Mar 21 07:49:10 1991
  51. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  52. if test -f 'nodelete.c' -a "${1}" != "-c" ; then 
  53.   echo shar: Will not clobber existing file \"'nodelete.c'\"
  54. else
  55. echo shar: Extracting \"'nodelete.c'\" \(6689 characters\)
  56. sed "s/^X//" >'nodelete.c' <<'END_OF_FILE'
  57. X/* NoDelete V1.5A (C) HooverSoft 1991
  58. X
  59. X    cc NoDelete +L
  60. X    ln NoDelete -la -lc32
  61. X
  62. X
  63. X*/
  64. X
  65. X
  66. X#ifdef AZTEC_C                    /* Works under Manx, convert it to Lattice */
  67. X                                    /* if you don't mind the hassle...             */
  68. X
  69. X#include<libraries/arpbase.h>
  70. X#include<intuition/intuition.h>
  71. X#include<intuition/intuitionbase.h>
  72. X#include<libraries/dos.h>
  73. X#include<libraries/dosextens.h>
  74. X#include<stdio.h>
  75. X/* #define DEBUG 1 */
  76. X
  77. Xchar bodystring[80],patterns[10][10], titlebak[80], title[80];
  78. XULONG answer, PAT_SET = 0L,  howmany = 0L;
  79. XULONG OVERRIDE = 0L, SILENT = 0L;
  80. X
  81. X
  82. Xstruct NewWindow mywindow = {
  83. X    100,0,    /* window XY origin relative to TopLeft of screen */
  84. X    350,10,    /* window width and height */
  85. X    0,1,    /* detail and block pens */
  86. X    CLOSEWINDOW+VANILLAKEY,    /* IDCMP flags */
  87. X    WINDOWDRAG+WINDOWDEPTH+WINDOWCLOSE+SIMPLE_REFRESH,    /* other window flags */
  88. X    NULL,    /* first gadget in gadget list */
  89. X    NULL,    /* custom CHECKMARK imagery */
  90. X    (UBYTE *)title,    /* window title */
  91. X    NULL,    /* custom screen pointer */
  92. X    NULL,    /* custom bitmap */
  93. X    5,5,    /* minimum width and height */
  94. X    640,110, /* maximum width and height */
  95. X    WBENCHSCREEN    /* destination screen type */
  96. X    };
  97. X
  98. X
  99. Xstruct IntuiText body = {
  100. X    1,0,
  101. X    JAM1|COMPLEMENT,
  102. X    30,16,
  103. X    NULL,
  104. X    NULL,
  105. X    NULL
  106. X    };
  107. X
  108. Xstruct IntuiText fbody = {
  109. X    1,0,
  110. X    JAM1|COMPLEMENT,
  111. X    30,5,
  112. X    NULL,
  113. X    (UBYTE *) "System tries to fool around...",
  114. X    &body
  115. X    };
  116. X
  117. Xstruct IntuiText ok = {
  118. X    1,0,
  119. X    JAM1|COMPLEMENT,
  120. X    6,3,
  121. X    NULL,
  122. X    (UBYTE *)    "Yes, Delete!",
  123. X    NULL
  124. X    };
  125. X
  126. Xstruct IntuiText no = {
  127. X    1,0,
  128. X    JAM1|COMPLEMENT,
  129. X    6,3,
  130. X    NULL,
  131. X    (UBYTE *)  "Oops, No Way!",
  132. X    NULL
  133. X    };
  134. X
  135. X
  136. Xstruct IntuiMessage *msg, *GetMsg();
  137. X
  138. Xstruct IntuitionBase *IntuitionBase;
  139. Xstruct Window            *mw, *aw, *OpenWindow();
  140. Xstruct DosBase            *DosBase;
  141. Xstruct ArpBase            *ArpBase;
  142. XUBYTE                        *filename;
  143. Xvoid                         *OpenLibrary();
  144. Xstruct Task                *FindTask();
  145. X
  146. Xvoid NoDelete()
  147. X{
  148. X    char parsed[10];
  149. X#asm
  150. X    public    _LVOSetProtection
  151. X
  152. X    movem.l    d0-d7/a0-a6,-(sp)
  153. X#endasm
  154. X    geta4();
  155. X#asm
  156. X    move.l    d1,_filename
  157. X#endasm
  158. X
  159. X    if(PAT_SET)
  160. X        {
  161. X
  162. X        for(answer=0L; answer < howmany; answer++)            
  163. X            {
  164. X            PreParse(patterns[answer], parsed);
  165. X            if( !PatternMatch(parsed, filename) ) /* this is new */
  166. X                continue;
  167. X            else
  168. X                goto request;
  169. X            }
  170. X        }
  171. X    else 
  172. X        goto request;
  173. X    goto delete_anyway;        
  174. X        
  175. Xrequest:
  176. X    strcpy(bodystring, "Delete File `");
  177. X    strcat(bodystring, (char *)filename);
  178. X    strcat(bodystring, "'?");
  179. X    body.IText = (UBYTE *) bodystring;
  180. X    aw = (struct Window *) IntuitionBase->ActiveWindow;
  181. X    answer = (long)AutoRequest(aw, &fbody, &ok, &no, NULL, NULL, 360L, 61L);
  182. X    if(!answer)
  183. X    {
  184. X        ;
  185. X#asm
  186. X    movem.l    (sp)+,d0-d7/a0-a6
  187. X    move.l    #1,d0
  188. X#endasm
  189. X    return;
  190. X    }
  191. X
  192. X    if(answer)
  193. X    {
  194. X
  195. Xdelete_anyway:
  196. X        ;
  197. X#asm
  198. X
  199. X        move.l    _DosBase,a6        
  200. X        move.l    #$70f7,d0            ;restore old vector
  201. X        move.w    d0,-72(a6)
  202. X        move.l    #$60000092,d0
  203. X        move.l    d0,-70(a6)
  204. X        
  205. X        tst.l        _OVERRIDE
  206. X        beq.s        _dont_unprotect
  207. X
  208. X        move.l    _filename,d1
  209. X
  210. X
  211. X        move.l    #0,d2
  212. X        jsr        _LVOSetProtection(a6)
  213. X
  214. X_dont_unprotect:
  215. X
  216. X        move.l    _filename,d1
  217. X        jsr        -72(a6)                ;DeleteFile() call
  218. X#endasm
  219. X
  220. X        ;
  221. X
  222. X        SetFunction(DosBase, -72L, &NoDelete);
  223. X
  224. X/* install our function */
  225. X
  226. X
  227. X#asm
  228. X        movem.l    (sp)+,d0-d7/a0-a6
  229. X        move.l    #1,d0
  230. X#endasm
  231. X        return;
  232. X        }
  233. X    }
  234. X        
  235. X
  236. Xvoid quit(why)
  237. XUBYTE *why;
  238. X{
  239. X    if(!SILENT)
  240. X        Printf(why);
  241. X    SetTaskPri((struct Task *)FindTask(0L), 0L);
  242. X    if(DosBase)
  243. X    {
  244. X        ;
  245. X#asm
  246. X        move.l    _DosBase,a6        
  247. X        move.l    #$70f7,d0            ;restore old vector
  248. X        move.w    d0,-72(a6)
  249. X        move.l    #$60000092,d0
  250. X        move.l    d0,-70(a6)
  251. X#endasm
  252. X        ;
  253. X    }
  254. X
  255. X    if    (mw)
  256. X        CloseWindowSafely(mw);
  257. X
  258. X    if(ArpBase)
  259. X        CloseLibrary(ArpBase);
  260. X    exit(0L);
  261. X}
  262. X
  263. X/* test_nd() tests the DeleteFile vector to see if NoDelete is already 
  264. X    installed. Returns zero if NoDelete is installed, one if it is not.
  265. X*/
  266. X#asm
  267. X        public    _test_nd
  268. X_test_nd:
  269. X
  270. X        move.l    _DosBase,a6
  271. X        cmpi.l    #$60000092,-70(a6)
  272. X        bne.s        _is_there                
  273. X        moveq        #1,d0
  274. X        bra.s        _fuckoff
  275. X_is_there:
  276. X        moveq        #0,d0
  277. X_fuckoff:
  278. X        rts    
  279. X#endasm
  280. X
  281. X
  282. Xvoid main(argc,argv)
  283. Xlong argc;
  284. Xchar *argv[];
  285. X    {
  286. X
  287. X    static UBYTE *msg1 = (UBYTE *)"Installing NoDelete...";
  288. X    static UBYTE *msg2 = (UBYTE *)"done. NoDelete V1.5A (c) HooverSoft 1991. \
  289. XThis Program is FREEWARE.\n";
  290. X    long i;
  291. X
  292. X    if(! (ArpBase = (struct ArpBase *) OpenLibrary("arp.library",0L) ) )
  293. X        quit("NoDelete needs arp.library\n");
  294. X    
  295. X    DosBase = (struct DosBase *) ArpBase->DosBase;
  296. X    IntuitionBase = (struct IntuitionBase *) ArpBase->IntuiBase;  
  297. X
  298. X    strcpy(title, (UBYTE *) "NoDelete V1.5A (c) HooverSoft");
  299. X
  300. X
  301. X    
  302. X
  303. X
  304. X            
  305. X
  306. X#ifdef    DEBUG
  307. X        Printf("I found %ld patterns.\n", howmany);
  308. X#endif            
  309. X
  310. X
  311. X
  312. X    for(i=1; i<argc; i++)
  313. X        {
  314. X#ifdef DEBUG
  315. X            Printf("Scanning argv[%ld]: %s\n", i, (UBYTE *) argv[i] );
  316. X#endif
  317. X            if( (char) argv[i][0] == '-')
  318. X                {
  319. X                switch( (char) argv[i][1] )
  320. X                    {
  321. X                    case 'y':    if( atoi(argv[i+1]) <= 245L)
  322. X                                        mywindow.TopEdge = atoi(argv[i+1]);
  323. X                                    i++;    
  324. X                                    goto fuckoff;                    
  325. X                                     break;
  326. X
  327. X                    case 'p':    if(atoi(argv[i+1]) < 10L && atoi(argv[i+1]) > -20L)
  328. X                                        SetTaskPri((struct Task *)FindTask(0L),\
  329. X                                                        (long)atoi(argv[i+1]));
  330. X                                    else
  331. X                                        SetTaskPri((struct Task *)FindTask(0L), -5L);
  332. X
  333. X                                    i++;
  334. X                                    goto fuckoff;
  335. X                                    break;
  336. X
  337. X
  338. X                    case  'O':    OVERRIDE = 1L;
  339. X                                    goto fuckoff;
  340. X                                    break;
  341. X                
  342. X                    case  'S':    SILENT = 1L;
  343. X                                    goto fuckoff;
  344. X                                    break;
  345. X                
  346. X                    case default:
  347. X                                    Printf("Unknown Option -%c\n", argv[i][1]); 
  348. X                                    goto fuckoff; 
  349. X                                    break;
  350. X                    }
  351. X                /* end switch */
  352. X                }/*end if */
  353. X            else
  354. X                {
  355. X                PAT_SET = 1L;
  356. X                if( howmany<10 )
  357. X                    strcpy(patterns[howmany], argv[i]);
  358. X#ifdef    DEBUG
  359. X                Printf("Copied %s, Result: %s\n", argv[i], patterns[i-1L]);
  360. X#endif    
  361. X                howmany++;
  362. X                }
  363. Xfuckoff:
  364. X            ;
  365. X        /*end for */
  366. X            }    
  367. X                    
  368. X    if(howmany)
  369. X        strcat(title, (UBYTE *) " PAT SET");            
  370. X    else
  371. X        {
  372. X        PAT_SET = 0L;
  373. X        strcat(title, (UBYTE *) " NO PAT");
  374. X        }
  375. X
  376. X/* calculate dimension of TitleBar */
  377. X
  378. X    mywindow.Width = ( strlen(title) * 8L) + 85L;
  379. X    mywindow.LeftEdge = (640L-mywindow.Width) / 2L;
  380. X
  381. X    if(!SILENT)
  382. X        Printf(msg1);
  383. X
  384. X    if( !test_nd() )
  385. X        {
  386. X        Printf("NoDelete already installed.\n");
  387. X        CloseLibrary(DosBase);
  388. X        CloseLibrary(IntuitionBase);
  389. X        CloseLibrary(ArpBase);
  390. X        exit(0L);
  391. X        }
  392. X
  393. X    mw = OpenWindow(&mywindow);
  394. X    if(!mw)
  395. X        quit("Could not open Window.\n\n");
  396. X    if(!SILENT)
  397. X        Printf(msg2);
  398. X
  399. X    SetFunction(DosBase, -72L, &NoDelete); 
  400. X
  401. X    for(;;)
  402. X        {
  403. X        Wait(1L << mw->UserPort->mp_SigBit);
  404. Xgetmsg:
  405. X        msg = GetMsg(mw->UserPort);
  406. X        ReplyMsg(msg);
  407. X        if (msg->Class == CLOSEWINDOW)
  408. X            quit("NoDelete V1.5A exiting.\n\n");
  409. X        if(msg->Class == VANILLAKEY)
  410. X            {
  411. X            strcpy(titlebak, (UBYTE *) "Patterns: ");
  412. X            for(i=0L; i < howmany ; i++)
  413. X                {
  414. X                strcat(titlebak, patterns[i]);
  415. X                strcat(titlebak, " ");
  416. X                }
  417. X            SetWindowTitles(mw, titlebak);
  418. X            Wait(1L << mw->UserPort->mp_SigBit);
  419. X            SetWindowTitles(mw, title);
  420. X            ReplyMsg( GetMsg(mw->UserPort) );
  421. X            }
  422. X
  423. X        else
  424. X            continue;
  425. X        }
  426. X    }
  427. X#endif    
  428. X    
  429. END_OF_FILE
  430. if test 6689 -ne `wc -c <'nodelete.c'`; then
  431.     echo shar: \"'nodelete.c'\" unpacked with wrong size!
  432. fi
  433. # end of 'nodelete.c'
  434. fi
  435. if test -f 'nodelete.doc' -a "${1}" != "-c" ; then 
  436.   echo shar: Will not clobber existing file \"'nodelete.doc'\"
  437. else
  438. echo shar: Extracting \"'nodelete.doc'\" \(10917 characters\)
  439. sed "s/^X//" >'nodelete.doc' <<'END_OF_FILE'
  440. X *************************************************************************
  441. X *              NoDelete V1.5A  (C) HooverSoft  Oct 30th, 1990            *
  442. X *************************************************************************
  443. X
  444. XUSAGE:    1> run NoDelete [patterns] [-p priority] [-y ypos] <ENTER>
  445. X            from CLI only.
  446. X
  447. X                                  HISTORY
  448. X
  449. X                     CHANGES TO VERSION 1.4: MAR 1991
  450. XSwitched  to  ARP  (finally).   This  great  bunch  of routines should have
  451. Xexperienced  a  wide  enough  distribution  by now to make this acceptable.
  452. XCheers to everyone involved in this project!  ARP is used to do the pattern
  453. Xmatching  on filenames.  No more restriction is made on the patterns.  They
  454. Xcan  be  complete  filenames  or  just  patterns,  with  every ARP wildcard
  455. Xallowed.   I forgot the name of the guy who suggested this one, and answers
  456. Xby  UUCP  is not a favourite of math4.unibi.de.  Anyway, as soon as this is
  457. Ximplemented, you'll get a "thank you", mate!
  458. X
  459. X                     CHANGES TO VERSION 1.35: OCT 1990
  460. XProgrammed  two  new options -O and -S (Cheers, John!).  These options sort
  461. Xof  "fix"  a  bug  with NoDelete which used to override the file protection
  462. Xbit.
  463. X
  464. X                     CHANGES TO VERSION 1.3: SEP 1990
  465. XLots  of  changes.   Thinking  of  writing  a  new  documentation.  Anyway,
  466. Xintroduced  command line options -p and -y for run-time setting of priority
  467. Xof NoDelete and of vertical position of titlebar.
  468. X
  469. X                     CHANGES TO VERSION 1.2: AUG 1990
  470. XIntroduced  the  possibilty  to  give  multiple patterns on startup.  Lists
  471. Xpatterns when pressing a key while Nodelete's titlebar is active.
  472. X
  473. X                     CHANGES TO VERSION 1.1: Aug 1990
  474. XNoDelete now automatically centers the Dragbar on Screen and calculates the
  475. Xcorrect width for the window if a pattern is specified.
  476. X
  477. XNow  works  fine  with  AmiOmega.   System won't crash if "Yes, Delete!" is
  478. Xselected.
  479. X
  480. XNow  supports  the  use  of  patterns to ask confirmations only for special
  481. Xfiles  ending  in  defined  pattern.   Will  show  the  selected pattern in
  482. Xwindow's titlebar.
  483. X
  484. XNoDelete  now  checks  if  another  NoDelete is already active and exits if
  485. Xtrue.
  486. X
  487. X                     CHANGES TO VERSION 1.01: Jul 1990
  488. XNow handles protected Files correctly.  Previous version didn't complain if
  489. Xfile was delete protected.
  490. X
  491. XNoDelete sets its priority to a value of -5 directly after startup.
  492. X
  493. X                    CHANGES TO VERSION 1.00: June 1990
  494. XVersion  1.01  now  restores  the  Dos Vector relative to _DosBase, so this
  495. Xprogram  should  work under Kickstart 1.3 as well.  If someone already uses
  496. XKick 2.0, he or she should let me know if NoDelete works with that.  I have
  497. Xheard  that  the  funny  instructions  in DosBase have been replaced with a
  498. Xregular jump table.
  499. X
  500. X
  501. X                           WHY USE NODELETE?
  502. XI  wrote  this  program  mainly  to  make  the fantastic public domain game
  503. X"Omega"  more  enjoyable  to  play.   The author of this program thought it
  504. Xreasonable to have the system unlink the save-file after having reloaded it
  505. Xto  somehow  "simulate the continuity of character".  Too bad that NoDelete
  506. Xdoes not work correctly with this program...
  507. XFootnote: It works now!
  508. X
  509. X                              WHAT IT DOES
  510. XNoDelete  enables  you  erraneous  humans  to  once  again  reflect  on the
  511. Xrighteousness  of  your  decisions  concerning  the  deleting  of  files on
  512. XAmigaDos devices.  If you try to delete a file or a program tries to remove
  513. Xit,  this  is  mostly  done  via  DeleteFile()  of  the  dos.library.  When
  514. Xexecuted,  NoDelete  bends  this  vector to its own routine which brings up
  515. Xthis  cute  little requester on the active window.  This requester contains
  516. Xthe  name  of  the file that the system is trying to delete.  If you really
  517. Xwant  to  delete  this  file,  click to the "Yes, Delete!" gadget.  If not,
  518. Xclick  to the "Oops, no way!"-Gadget of the requester.  NoDelete works just
  519. Xfine   with   aliases,   wildcards   etc.   For  problems  see  the  "known
  520. Xbugs"-section of this text.
  521. X
  522. X                                 PATTERNS
  523. XLots  of programs, programmers and normal people use patterns in their file
  524. Xsystem  to  be  able  to  immediately make out the contents of a file.  For
  525. Xexample,  ".c"  specifies  the file to be a C source code and ".bas" should
  526. Xcontain  a  basic  program's  source.   There  are  tons of frequently used
  527. Xextensions,  from  ".asm"  up to ".cfg".  If you use NoDelete and you don't
  528. Xwant  the  system to get on your nerves by confirming EVERY rm command, you
  529. Xshould  use a certain extension on NoDelete's command line to tell NoDelete
  530. Xthat  it  should  only  ask  confirmation for those precious ".c" or ".iff"
  531. Xfiles and let all others alone.
  532. X
  533. XThe  new  version  of  NoDelete also supports complete filenames as pattern
  534. Xmatching is done via PatternMatch() of ARP.  The command line
  535. X
  536. X        1> run nodelete *.c
  537. X
  538. Xwould  tell NoDelete to only intercept the removing of files ending in ".c"
  539. Xand not to worry about any other files that are removed from the device.
  540. X
  541. XYou can specifiy up to ten patterns when running NoDelete. The command
  542. X
  543. X        1> run NoDelete *.c *.iff *.tex *.asm
  544. X
  545. Xwill  make  NoDelete  complain  about  any  file  which  ends in one of the
  546. Xspecified patterns and leave all others alone.  If you have forgotten which
  547. Xpatterns  you  specified  at startup, just activate NoDelete's titlebar and
  548. Xpress  any key.  NoDelete will then give a list of patterns in the titlebar
  549. Xuntil another key is pressed.
  550. X
  551. XAnother one:
  552. X
  553. X        1> run NoDelete Peter Pecker picked a pepper
  554. X
  555. Xwould  intercept  any attempt to remove the files peter, pecker, picked, a,
  556. Xand pepper.  NoDelete does discriminate between upper or lower case letters
  557. Xin  filenames.   If the extensions get too long to fit into the titlebar...
  558. Xwell, you won't see them!
  559. X
  560. XTo make things totally clear, let me cite the ARP programmer's manual:
  561. X
  562. XCITE
  563. Xarp.doc/PatternMatch (V31)
  564. X     NAME
  565. X        PatternMatch - perform a wildcard match on a string
  566. X     SYNOPSIS
  567. X        result = PatternMatch(pat,str)
  568. X          D0                 A0   A1
  569. X     FUNCTION
  570. X        This function compares a string to the given pattern and determines
  571. X           if it is a valid match.  If so it returns a true result.
  572. X           The pattern must be constructed with special preparsed tokens and
  573. X           supports the following patterns:
  574. X            (p1|p2|p3)  One of the patterns p1, p2 or p3
  575. X            ?           Any single character
  576. X            #<pat>      Pattern repeated 0 or more times
  577. X            [class]     Character class
  578. X            [^class]    Negated character class
  579. X            {pat}       Structure tag for replacement
  580. X            *           0 or more occurances of any character
  581. X     INPUTS
  582. X       char *pat     The pattern string to match against
  583. X          char *str     The string to be matched
  584. X     RESULT
  585. X       result - a boolean value indicating success/failure.  The condition
  586. X            codes are guarenteed to reflect the status of the result
  587. X     
  588. X     BUGS
  589. X       None known.
  590. X     SEE ALSO
  591. X     Author:    JAT
  592. XEND CITE
  593. X
  594. XRight?  So far for all the wildcards you can use with ARP.  IMPORTANT NOTE:
  595. Xif  you  work  with  Csh  or  WB  1.3  shell,  you  will have to escape the
  596. Xcharacters special to these shells, respectively.  To protect all C sources
  597. Xwhile in Csh, you would use the syntax
  598. X
  599. X        $ run nodelete \*.c
  600. X
  601. Xto have the special shell wildcard "*" survive on its way to NoDelete.
  602. X
  603. X
  604. X
  605. X                           COMMAND LINE OPTIONS
  606. XFinally,  HooverSoft  is  proud  to have introduced command line options in
  607. XNoDelete.  So far, four options are supported:
  608. X
  609. X-p    number    where number is an integer between -20 and 9. If given on
  610. X                the command line, NoDelete will set its priority to this
  611. X                value.  If you type rubbish or use values not allowed, the
  612. X                default priority of -5 is set.
  613. X
  614. X-y ypos        where ypos is an integer ranging from zero to 245 (sorry,
  615. X                all you NTSC users...).  This number will determine the ver-
  616. X                tical position of NoDelete's titlebar.  if you try to fool
  617. X                NoDelete or do not give this option, the default value zero
  618. X                (top of screen) is used.
  619. X
  620. X-O                Override file protection bit. If this option is given,
  621. X                NoDelete will NOT care about the file's protection status.
  622. X                This option is sort of dangerous, but I think if you are
  623. X                explicitly asked wether you want to delete a file this
  624. X                should be presto! wiped off the disk without return or
  625. X                any other chance of survival..., Anyway, the default now
  626. X                is to consider and respect the file protection.
  627. X
  628. X-S                if given, this option tells NoDelete to shut up. No screams,
  629. X                no comments!
  630. X
  631. X                               KNOWN BUGS
  632. XNoDelete  cannot  take  care of the AmigaDos command Delete.  God knows how
  633. Xthis command erases a disk file...
  634. X
  635. XThe  Shell  won't complain if you try to delete any non-existent file while
  636. XNoDelete  has  its  grip  on  the system.  This is not really a bug because
  637. XNoDelete  works  on  this  basis  of  cheating  the  calling  function  and
  638. Xpretending that everything is just fine and deleted. This also is the cause
  639. Xthat the calling program will not be informed if the file in question
  640. Xis delete protected.
  641. X
  642. X                            THE LEGAL STUFF
  643. XNoDelete  is  FreeWare  and  may  be  copied  freely by everyone except for
  644. Xpurposes  listed below as long as this notice is left intact.  This program
  645. Xis  copyright  (C)  by  HooverSoft.   It  may  NOT  be  copied  or sold for
  646. Xcommercial  purposes  without  written  permssion  by the author (Get lost,
  647. XCarsten  Wolf and all you other sharks!).  It may be distributed and copied
  648. Xfreely for non-commercial purposes only.
  649. X
  650. XWhen  distributed,  this program should always be accompanied by this file,
  651. Xthe documentation.
  652. X
  653. X                    FURTHER PLANS & HOPELESS DREAMS
  654. XI  would  like  to use CreateTask() to launch a separate Task for Nodelete.
  655. XThis would unlink NoDelete's memory requirements from the current stacksize
  656. Xof  the  system.  It would be nice if "delete" could also be disabled but I
  657. Xam not sure how to do this. 
  658. X
  659. X                                  CREDITS
  660. XI'm very thankful to all those people who have continued to make their
  661. Xsources available through FreeWare, especially Fred Fish, Udo K Schuermann
  662. X(The walrus and maintainer of Akvarium Data Files) and Matt Dillon.
  663. X
  664. X                            PUBLIC FEEDBACK
  665. XBug  reports  (cheers, Jensi & John!), criticism, comments and approvements
  666. Xshould be sent to
  667. X                        
  668. X                SNAIL:
  669. X                              HooverSoft Inc.
  670. X                            Joellenbecker Weg 4
  671. X                              D-4900 Herford
  672. X                                  Germany
  673. X
  674. X                BITNET:            
  675. X                          hoover@math4.uni-bielefeld.de
  676. X
  677. X                                DISCLAIMER
  678. XDo  whatever you like with this program, but listen:  you can't blaim it on
  679. Xme if anything goes down the drain!
  680. XHave fun,
  681. XHoover
  682. X
  683. X--
  684. X"It's impossible to make things foolproof because fools are so ingenious..."
  685. END_OF_FILE
  686. if test 10917 -ne `wc -c <'nodelete.doc'`; then
  687.     echo shar: \"'nodelete.doc'\" unpacked with wrong size!
  688. fi
  689. # end of 'nodelete.doc'
  690. fi
  691. if test -f 'nodelete.uu' -a "${1}" != "-c" ; then 
  692.   echo shar: Will not clobber existing file \"'nodelete.uu'\"
  693. else
  694. echo shar: Extracting \"'nodelete.uu'\" \(6418 characters\)
  695. sed "s/^X//" >'nodelete.uu' <<'END_OF_FILE'
  696. Xbegin 666 nodelete
  697. XM```#\P`````````#``````````(```0'````NP````$```/I```$!T[Z!\!3;
  698. XM>7-T96T@=')I97,@=&\@9F]O;"!A<F]U;F0N+BX``%EE<RP@1&5L971E(0``P
  699. XM3V]P<RP@3F\@5V%Y(0!.5?_V2.?__DZZ!^HI08*62JR``F=&0JR">F`T2&W_R
  700. XM]G(*("R">DZZ#AA![(%VT(@O`$ZZ!J)03R\L@I9(;?_V3KH&AE!/2D!G`F`49
  701. XM4JR">B`L@GJPK(`&9<)@`F`"8'I(>@#&2&R!)DZZ!GI03R\L@I9(;($F3KH*3
  702. XMEE!/2'H`N$AL@29.N@J(4$]![($F*4B`3B!L@H(I:``T@HI(>``]2'@!:$*G&
  703. XM0J=(;(!^2&R`:DAL@%8O+(**3KH.Y$_O`"`I0()Z2JR">F8*3-]__W`!3EU.<
  704. XM=4JL@GIG3"QL@HX@/```</<]0/^X(#Q@``"2+4#_NDJL@`IG"B(L@I9T`$ZNT
  705. XM_T8B+(*63J[_N$AZ_O1(>/^X+RR"CDZZ#B1/[P`,3-]__W`!8*I@J$1E;&5T2
  706. XM92!&:6QE(&``)S\``$Y5``!*K(`.9@HO+0`(3KH%8%A/0J="ITZZ#8Q83R\`#
  707. XM3KH-]%!/2JR"CF<8+&R"CB`\``!P]SU`_[@@/&```)(M0/^Z2JR"AF<*+RR",
  708. XMADZZ!3!83TJL@I)G"B\L@I).N@TH6$]"ITZZ"Q183TY=3G4L;(*.#*Y@``"2Q
  709. XM_[IF!'`!8`)P`$YU3E7__$*G2'H$'$ZZ#4Q03RE`@I)F"DAZ!!A.NO]>6$\@)
  710. XM;(*2*6@`,(*.(&R"DBEH`#B"@DAZ!!9(;((J3KH$YE!/*WP````!__Q@``&4C
  711. XM("W__.6`(&T`#")P"``,$0`M9@`!/B`M__SE@"!M``PB<`@`$"D``4B`2,!@9
  712. XM``$`("W__%*`Y8`@;0`,+S`(`$ZZ!+983["\````]6X:("W__%*`Y8`@;0`,J
  713. XM+S`(`$ZZ!)A83SE`@!12K?_\8``!("`M__Q2@.6`(&T`#"\P"`!.N@1V6$^P2
  714. XMO`````IL2"`M__Q2@.6`(&T`#"\P"`!.N@186$^PO/___^QO*B`M__Q2@.6`Q
  715. XM(&T`#"\P"`!.N@0Z6$\O`$*G3KH,"EA/+P!.N@QR4$]@%$AX__M"ITZZ"_184
  716. XM3R\`3KH,7%!/4JW__&```)XI?`````&`"F```)(I?`````&`#F```(8@+?_\)
  717. XMY8`@;0`,(G`(`!`I``%(@$C`+P!(>@+V3KH#=%!/8&"0O````$]GO%F`9\20[
  718. XMO````!UG`/\ND+P````)9P#^Y&"Z8#PI?`````&``@RL````"H`&9"8@+?_\#
  719. XMY8`@;0`,+S`(`'(*("R`!DZZ"KA![(%VT(@O`$ZZ`U!03U*L@`92K?_\("W_L
  720. XM_+"M``AM`/YD2JR`!F<02'H"B$AL@BI.N@=24$]@$D*L@`)(>@)]2&R"*DZZ:
  721. XM!SY03TAL@BI.N@,:6$_G@-"\````53E`@!8@/````H`R+(`62,&0@7("3KH(7
  722. XM$CE`@!)*K(`.9@HO+("23KH"G%A/3KK]EDJ`9C!(>@(Q3KH"BEA/+RR"CDZZI
  723. XM"IA83R\L@H).N@J.6$\O+(*23KH*A%A/0J=.N@AP6$](;(`23KH+;%A/*4"""
  724. XMADJL@H9F"DAZ`@I.NOS66$]*K(`.9@HO+("63KH"-EA/2'K[ADAX_[@O+(*.T
  725. XM3KH*MD_O``P@;(*&(F@`5G``$"D`#W(!X:$O`4ZZ"KY83R!L@H8O*`!63KH*M
  726. XM6%A/*4""?B\L@GY.N@IN6$\@;()^#*@```(``!1F"DAZ`;%.NOQD6$\@;()^_
  727. XM#*@`(````!1F``":2'H!L4AL@=I.N@'P4$]"K?_\8"YR"B`M__Q.N@DZ0>R!X
  728. XM=M"(+P!(;(':3KH%^%!/2'H!C$AL@=I.N@7J4$]2K?_\("W__+"L@`9ER$ALI
  729. XM@=HO+(*&3KH*B%!/(&R"AB)H`%9P`!`I``]R`>&A+P%.N@H&6$](;((J+RR"$
  730. XMADZZ"F!03R!L@H8O*`!63KH)DEA/+P!.N@FN6$]@`/\(3EU.=4EN<W1A;&QI,
  731. XM;F<@3F]$96QE=&4N+BX`9&]N92X@3F]$96QE=&4@5C$N-4$@J2!(;V]V97)3-
  732. XM;V9T(#$Y.3$N(%1H:7,@4')O9W)A;2!I<R!&4D5%5T%212X*`&%R<"YL:6)R:
  733. XM87)Y`$YO1&5L971E(&YE961S(&%R<"YL:6)R87)Y"@!.;T1E;&5T92!6,2XUU
  734. XM02"I($AO;W9E<E-O9G0`56YK;F]W;B!/<'1I;VX@+25C"@`@4$%4(%-%5``@2
  735. XM3D\@4$%4`$YO1&5L971E(&%L<F5A9'D@:6YS=&%L;&5D+@H`0V]U;&0@;F]TT
  736. XM(&]P96X@5VEN9&]W+@H*`$YO1&5L971E(%8Q+C5!(&5X:71I;F<N"@H`4&%T&
  737. XM=&5R;G,Z(``@`"!O``1#[P`(+&R"DD[N_QQ,[P,```0L;(*23N[^U$SO`P``P
  738. XM!"QL@I).[OY03.\#```$+&R"DD[N_=(@;P`$(`@B;P`($-EF_$YU(&\`!"`(0
  739. XM2AAF_)'`(`A3@$YU3E4``$CG#"`D;0`(#!(`(&<&#!(`"68$4HI@\'H`#!(`J
  740. XM+68&>@%2BF`(#!(`*V8"4HIX`&`@($I2BA`02(!(P'(*+P`@!$ZZ!O(B']*`U
  741. XM*`&8O````#`0$DB`2,!![(";"#```@@`9LY*A6<&(`1$@&`"(`1,WP0P3EU.?
  742. XM=6%P0^R!)D7L@2:UR68.,CP`<6L(=``BPE')__PI3X*:+'@`!"E.@IY(YX"`G
  743. XM""X`!`$I9Q!+^@`(3J[_XF`&0J?S7TYS0_H`($ZN_F@I0(*B9@PN/``#@`=.G
  744. XMKO^48`1.N@`:4$].=61O<RYL:6)R87)Y`$GY``!__DYU3E4``"\*2'D``0``R
  745. XM,"R!','\``8O`$ZZ!KXI0(*F4$]F%$*G2'D``0``3KH&@E!/+FR"FDYU(&R""
  746. XMID)H``0@;(*F,7P``0`0(&R"IC%\``$`"B!L@IH@+(*:D*@`!%"`*4""JB!LO
  747. XM@JH@O$U!3EA"ITZZ!G8D0$JJ`*Q83V<P+RT`#"\M``@O"DZZ`+(I?`````&"2
  748. XMKB!L@J8`:(````0@;(*F`&B````*3^\`#&!"2&H`7$ZZ!KQ(:@!<3KH&5"E`1
  749. XM@K(@;(*R2J@`)%!/9Q`@;(*R(F@`)"\13KH%FEA/+RR"LB\*3KH">"EL@K*"Q
  750. XMME!/3KH%CB!L@J8@@$ZZ!9H@;(*F(4``!F<62'@#[4AZ`"Q.N@5V(&R"IB%`Y
  751. XM``Q03R\L@K8O+(*Z3KKXG$*G3KH#C$_O``PD7TY=3G4J`$Y5``!(YPPP)&T`U
  752. XM$"!M``A*J`"L9Q@@;0`(("@`K.6`*``@1"`H`!#E@"9`8`0F;($>$!-(@$C`G
  753. XMT*T`#%2`*4""OD*G+RR"ODZZ!5`I0(+"4$]F"$S?##!.74YU$!-(@$C`*@`O"
  754. XM!2!+4H@O""\L@L).N@&.(&R"PM'%0_H!6!#99OPO+0`,+PHO+(+"3KH!3B!LA
  755. XM@L)",%@`*7P````!@KH@;(+"T<4F2%*+)$M/[P`8$!-(@$C`*@"PO````"!GV
  756. XM(+J\````"6<8NKP````,9Q"ZO`````UG"+J\````"F8$4HM@S`P3`"!M``",T
  757. XM#!,`(F8R4HL@2U*+$!!(@$C`*@!G("!*4HH0A;J\````(F80#!,`(F8$4HM@P
  758. XM!D(J__]@`F#28$0@2U*+$!!(@$C`*@!G,+J\````(&<HNKP````)9R"ZO```"
  759. XM``QG&+J\````#6<0NKP````*9P@@2E**$(5@PB!*4HI"$$J%9@)3BU*L@KI@X
  760. XM`/\\0A)"IR`L@KI2@.6`+P!.N@04*4""ME!/9@A"K(*Z8`#^OGH`)FR"PF`>(
  761. XM(`7E@"!L@K8ABP@`($L@"$H89OR1P%.(4HC7R%*%NJR"NFW<(`7E@"!L@K9"0
  762. XML`@`8`#^@B``,#Q__V`$,"\`#B!O``1*&&;\4T@B;P`(4T`0V5?(__QG`D(0/
  763. XM("\`!$YU3.\#```$(`@B+P`,8`(0V5?)__QG!E)!8`)"&%')__Q.=4Y5``!("
  764. XMYPXP)&T`"$*G2'H`CDZZ`ZXI0(+&4$]F"$S?#'!.74YU(&T`#")H`"0O*0`$F
  765. XM3KH$!"@`6$]G4DAZ`&T@1"\H`#9.N@/6)D!*@%!/9S1(>`/M+PM.N@+0+`!0#
  766. XM3V<D(`;E@"H`($4E:``(`*0E1@"<2'@#[4AZ`#A.N@*L)4``H%!/+P1.N@.B8
  767. XM6$\O+(+&3KH"U$*L@L983V"`:6-O;BYL:6)R87)Y`%=)3D1/5P`J`$CG2`!"L
  768. XMA$J`:@1$@%)$2H%J!D2!"D0``6$^2D1G`D2`3-\`$DJ`3G5(YT@`0H1*@&H$^
  769. XM1(!21$J!:@)$@6$:(`%@V"\!81(@`2(?2H!.=2\!808B'TJ`3G5(YS``2$%*3
  770. XM068@2$$V`30`0D!(0(##(@!(0#("@L,P`4)!2$%,WP`,3G5(028!(@!"04A!`
  771. XM2$!"0'0/T(#3@;:!8@22@U)`4<K_\DS?``Q.=4Y5``!*K(+*9P8@;(+*3I`OR
  772. XM+0`(3KH`"%A/3EU.=4Y5__PO!"MM``C__$JL@J9G+'@`8`HO!$ZZ`/Q83U*$-
  773. XM,"R!'$C`N(!M[#`L@1S!_``&+P`O+(*F3KH!ZE!/2JR"SF<&(&R"SDZ02JR!V
  774. XM(F<*+RR!(DZZ`7!83TJL@M)G""!L@M(@K(+62JR"VF<*+RR"VDZZ`7Y83TJL,
  775. XM@MYG"B\L@MY.N@%N6$]*K(+B9PHO+(+B3KH!7EA/2JR"YF<*+RR"YDZZ`4Y8#
  776. XM3RQX``0(+@`$`2EG%"\-2_H`"DZN_^(J7V`&0J?S7TYS2JR"LF8J2JR"PF<BF
  777. XM+RR"OB\L@L).N@%&("R"NE*`Y8`O`"\L@K9.N@$T3^\`$&`.3KH!(B\L@K).+
  778. XMN@%:6$\@+?_\+FR"FDYU*!].74YU3E4``$CG#B`H+0`(<@8@!$ZZ`$0D0-7L<
  779. XM@J9*A&T.,"R!'$C`N(!L!$J29A(I?`````*"ZG#_3-\$<$Y=3G4P*@`$P'R`7
  780. XM`&8(+Q).N@`N6$]"DG``8.!(YW``-`'$P"8!2$/&P$A#0D/4@TA`P,%(0$)`:
  781. XMT(),WP`.3G4B+P`$+&R"HD[N_]PB+P`$+&R"HD[N_X(L;(*B3N[_RDSO``8`&
  782. XM!"QL@J).[O_B+&R"HD[N_\1.^@`"(B\`!"QL@J).[O^F2.<!!$SO((``#"QL'
  783. XM@IY.KO^43-\@@$YU3OH``B)O``0L;(*>3N[^8DSO``,`!"QL@IY.[O\Z3OH`G
  784. XM`B)O``0L;(*>3N[^VBQL@IY.[O]\(F\`!"`O``@L;(*>3N[_+D[Z``(@;P`$\
  785. XM+&R"GD[N_HQ.^@`"+&R"GB)O``0@+P`(3N[]V$[Z``(B;P`$+&R"GD[N_H8BV
  786. XM;P`$(&\`""`O``PL;(*>3N[^7")O``0@+P`(+&R"GD[N_M0@+P`$+&R"GD[NL
  787. XM_L(@;P`$+&R"GD[N_H!,[P,```0L;(+&3N[_H"!O``0L;(+&3N[_IB!O``0L5
  788. XM;(+&3N[_LDCG`#!,[P\```Q,[P`/`!PL;(*"3J[^I$S?#`!.=2!O``0L;(*"?
  789. XM3N[_-"\*3.\'```(+&R"@DZN_NPD7TYU```#[`````$````!```(-@``````I
  790. XM``/R```#Z@```$D``````````````````````&0```%>``H``0`@`@````!.I
  791. XM``````````````(H````````````!0`%`H``;@`!`0`"```>`!``````````6
  792. XM```````!``(``!X`!0`````````$````0`$``@``!@`#`````````"0`````:
  793. XM`0`"```&``,`````````,@````````7*```%X0`@("`@("`@("`P,#`P,"`@#
  794. XM("`@("`@("`@("`@("`@()!`0$!`0$!`0$!`0$!`0$`,#`P,#`P,#`P,0$!`(
  795. XM0$!`0`D)"0D)"0$!`0$!`0$!`0$!`0$!`0$!`0$!0$!`0$!`"@H*"@H*`@(",
  796. XM`@("`@("`@("`@("`@("`@)`0$!`(```%``````````````#[`````(````!(
  797. XM````*@```&0````%`````````&````!T````B````)````"4`````````_(`(
  798. X+``/K`````0```_(%I
  799. X``
  800. Xend
  801. Xsize 4556
  802. END_OF_FILE
  803. if test 6418 -ne `wc -c <'nodelete.uu'`; then
  804.     echo shar: \"'nodelete.uu'\" unpacked with wrong size!
  805. fi
  806. # end of 'nodelete.uu'
  807. fi
  808. echo shar: End of archive 1 \(of 1\).
  809. cp /dev/null ark1isdone
  810. MISSING=""
  811. for I in 1 ; do
  812.     if test ! -f ark${I}isdone ; then
  813.     MISSING="${MISSING} ${I}"
  814.     fi
  815. done
  816. if test "${MISSING}" = "" ; then
  817.     echo You have the archive.
  818.     rm -f ark[1-9]isdone
  819. else
  820.     echo You still need to unpack the following archives:
  821.     echo "        " ${MISSING}
  822. fi
  823. ##  End of shell archive.
  824. exit 0
  825. -- 
  826. Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
  827. Mail comments to the moderator at <amiga-request@uunet.uu.net>.
  828. Post requests for sources, and general discussion to comp.sys.amiga.misc.
  829.